<?php
/**
 * Created by PhpStorm.
 * UsersF: Mloong
 * Date: 2018/12/25
 * Time: 14:41
 */

namespace app\admin\model;


use think\Model;

class Banner extends Model
{
    public static function addBanner($data)
    {
        $data['add_time'] = now_time();
        return self::create($data);
    }
    public static function upBanner($data)
    {
        $data['up_time'] = now_time();
        return self::where('banner_id','=',$data['banner_id'])
            ->update($data);
    }
    public static function findOne($id)
    {
        return self::where('banner_id','=',$id)
            ->find();
    }
    public static function delOne($id)
    {
        return self::where('banner_id','=',$id)
            ->delete();
    }
}